function setMinHeight(obj) {
	var newHeight = "";
	var height = window.innerHeight;
	newHeight = height-215;
	document.getElementById(obj).style.minHeight= newHeight +"px";
}

function autoTextarea (elem, extra, maxHeight) {
	extra = extra || 0;
	var isFirefox = !!document.getBoxObjectFor || 'mozInnerScreenX' in window,
		isOpera = !!window.opera && !!window.opera.toString().indexOf('Opera'),
		addEvent = function(type, callback) {
			elem.addEventListener ?
				elem.addEventListener(type, callback, false) :
				elem.attachEvent('on' + type, callback);
		},
		getStyle = elem.currentStyle ? function(name) {
			var val = elem.currentStyle[name];
			if (name === 'height' && val.search(/px/i) !== 1) {
				var rect = elem.getBoundingClientRect();
				return rect.bottom - rect.top -
					parseFloat(getStyle('paddingTop')) -
					parseFloat(getStyle('paddingBottom')) + 'px';
			};
			return val;
		} : function(name) {
			return getComputedStyle(elem, null)[name];
		},
		minHeight = parseFloat(getStyle('height'));
	elem.style.resize = 'none';
	var change = function() {
		var scrollTop, height,
			padding = 0,
			style = elem.style;
		if (elem._length === elem.value.length) return;
		elem._length = elem.value.length;
		if (!isFirefox && !isOpera) {
			padding = parseInt(getStyle('paddingTop')) + parseInt(getStyle('paddingBottom'));
		};
		scrollTop = document.body.scrollTop || document.documentElement.scrollTop;
		elem.style.height = minHeight + 'px';
		if (elem.scrollHeight > minHeight) {
			if (maxHeight && elem.scrollHeight > maxHeight) {
				height = maxHeight - padding;
				style.overflowY = 'auto';
			} else {
				height = elem.scrollHeight - padding;
				style.overflowY = 'hidden';
			};
			style.height = height + extra + 'px';
			scrollTop += parseInt(style.height) - elem.currHeight;
			document.body.scrollTop = scrollTop;
			document.documentElement.scrollTop = scrollTop;
			elem.currHeight = parseInt(style.height);
		};
	};
	addEvent('propertychange', change);
	addEvent('input', change);
	addEvent('focus', change);
	change();
};
function getNowFormatDate() {
    var date = new Date();
    var seperator1 = "-";
    var seperator2 = ":";
    var month = date.getMonth() + 1;
    var strDate = date.getDate();
    if (month >= 1 && month <= 9) {
        month = "0" + month;
    }
    if (strDate >= 0 && strDate <= 9) {
        strDate = "0" + strDate;
    }
    var currentdate = date.getFullYear() + month  + strDate + date.getHours()  + date.getMinutes()  + date.getSeconds();
    return currentdate;
}

function Fixed(val){
	var val = val + "";
	var val1 = "";
	var val2 = ""
	if(val && val.indexOf(".")!=-1){
		var result = val.split(".");
		if(result[1].length>3){
			val2 = result[1].substring(0,3)
		}
		val1 = result[0] + "." + val2;
		return val1;
	}else{
		return val;
	}
	
}

var baseFileUrl = "http://47.106.160.27/sysfile/"

function ObjStory(wordList,wordId){
    this.wordList = wordList;
    this.wordId = wordId;
}

String.prototype.ResetBlank=function(){
 var regEx = /\s+/g; 
 return this.replace(regEx, ' '); 
};

